#pragma once

#include <QObject>
#include <vector>
#include <QString>

class CapitalMarketSettings: public QObject
{
	Q_OBJECT

public:
    enum CapitalMarketType {
        Funds = 0,
        Assets,
        MaxCount = 2
    };
    enum CapitalMarketGroupID {
        DR=0,
        GC,
        Shibor,
        FR,
        FDR,
        IRS,
        Index
    };

    static CapitalMarketSettings& instance(const CapitalMarketType& type);

    void loadRecord();
    void saveRecord();

    static const QString getName(const int& id);
    static const int getBaseId(const CapitalMarketGroupID& group_id);
    std::vector<int> getDefaultOrder() const;
    std::vector<int> getAllOrder() const;
    const std::vector<int>& getOrder() const {return m_record;}
    void setOrder(const std::vector<int>& order);
    void setOrder(std::vector<int>&& order);

signals:
    void orderChanged();

private:
    CapitalMarketSettings(const CapitalMarketType& type);

private:
    std::vector<int> m_record;
    const CapitalMarketType m_type;
};
